﻿using Gnivc.CarDealership.Api.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using static Gnivc.CarDealership.Api.Infrastructure.Persistence.PersistenceConstants;

namespace Gnivc.CarDealership.Api.Infrastructure.Persistence.Configurations;

public class BrandConfiguration : IEntityTypeConfiguration<Brand>
{
    public void Configure(EntityTypeBuilder<Brand> builder)
    {
        builder.ToTable(TableNames.Brands, SchemaNames.Retail)
            .HasKey(x => x.Id);

        builder.Property(x => x.Name)
            .HasMaxLength(255);
    }
}
